﻿Imports Tajan.Monitoring.Entities

Public Class RepositoryFactory

    Private _monitoringEntities As MonitoringEntities

    Public Sub New()
        Me._monitoringEntities = New MonitoringEntities
    End Sub

    Public Function GetRepositiry(Of T As IBaseRepository)() As T

        Dim out As T = System.Activator.CreateInstance(Of T)()
        out.Context = Me._monitoringEntities
        Return out

    End Function

    Public Sub Commit()
        Me._monitoringEntities.SaveChanges()
    End Sub

End Class
